{extend name="public/base" /} {block name="css"}
<link rel="stylesheet" href="__INDEX__/css/create-index.css"> {/block} {block name="container"}
<div>
    <form action="" method="post" enctype="multipart/form-data">
    <div class="panel-body panel-body-nopadding" id="print">
        <div class="inforMain">客户信息</div>
        <div class="form-groups">
            <label class="col-sm-1 control-label">
                <span>*</span>客户名称：</label>
            <div class="col-sm-6">
                {$data['customer']['name'] ?? ''}
            </div>
        </div>
        <div class="form-groups">
            <label class="col-sm-1 control-label">
                <span>*</span>联系电话：</label>
            <div class="col-sm-6">
                {$data['customer']['phone'] ?? ''}
            </div>
        </div>
        <div class="form-groups">
            <label class="col-sm-1 control-label">
                <span>*</span>性&emsp;&emsp;别：</label>
            <div class="col-sm-6">
                {$data['customer']['sex'] ?? ''}
            </div>
        </div>
        <div class="form-groups">
            <label class="col-sm-1 control-label">
                <span>*</span>年&emsp;&emsp;龄：</label>
            <div class="col-sm-6">
                {$data['customer']['age'] ?? ''}
            </div>
        </div>
        <div class="form-groups" style="padding-bottom: 10px">
            <label class="col-sm-1 control-label">
                <span>*</span>收货地址：</label>
            <div class="col-sm-6">
                {$data['customer']['dizhi'] ?? ''}
            </div>
        </div>


        <div class="form-group">
                <label class="col-sm-12 control-label" style="background: #7F7F7F;text-align: center;color: #000;">订单信息
                    <div style="display: inline-block;background: #7F7F7F;padding-left:200px;font-size: 12px">产品编号:
                        <input type="text" style="background: #7F7F7F;border:0" name="order[pro_num]"  value="">
                    </div>
                </label>
                <div class="col-sm-12">
                    <table class="table ">
                        <tr>
                            <td>品类</td>
                            <td colspan="8">
                                {volist name="category" id="vo"}
                                <input type="radio" value="{$vo.id}" {if condition="$data['category_id'] eq $vo['id']"} checked {/if} name="order[category_id]" disabled style="width: auto;" > {$vo.title}
                                {/volist}
                            </td>
                        </tr>
                        <tr>
                            <td>款式编号</td>
                            <td colspan="2">
                                <input type="text" name="order[style_num]"  value="{$data['style_num'] ?? ''}" style="width: 100%">
                            </td>
                            <td>面料编号</td>
                            <td colspan="2">
                                <input type="text" name="order[ml_num]"  value="{$data['ml_num'] ?? ''}" style="width: 100%">
                            </td>
                            <td>订单属性</td>
                           <td colspan="2" style="display: flex;justify-content: center;">
                             <input type="radio" value="2" name="order[shuxing]" {if condition="$data['shuxing'] eq 2"} checked {/if} style="width: auto;"><p style="color: #676a6c !important;">售后订单</p>
                             <input type="radio" value="1" name="order[shuxing]" {if condition="$data['shuxing'] eq 1"} checked {/if} style="width: auto;margin-left: 10px;"><p style="color: #676a6c !important;">正常订单</p>
                           </td>
                        </tr>
                        <tr>
                            <td>款式细节</td>
                            <td colspan="8">
                                <textarea name="order[detail]" id=""  cols="30" rows="10" style="border:0px;width: 100%;outline: none;">{$data['detail'] ?? ''}</textarea>
                            </td>
                        </tr>
                                                        <tr>
            <td>着装风格</td>
            <td colspan="8">
                {$data['yifu_style'] ?? '暂无'}
            </td>
        </tr>
                        <tr>
                            <td>特殊备注</td>
                            <td colspan="4">
                                <input type="text" style="width: 100%;" name="order[comment]"  value="{$data['comment'] ?? ''}">
                            </td>
                            <td>加急</td>
                            <td colspan="3">
                                <input type="radio" style="display: inline-block;width: auto;" {if condition="$data['is_urgent'] eq 1"} checked {/if} disabled name="order[is_urgent]" value="1">是
                                <input type="radio" style="display: inline-block;width: auto;"  {if condition="$data['is_urgent'] eq 0"} checked  {/if}  disabled name="order[is_urgent]"  value="0">否
                                <div style="display: inline-block;">加急
                                    <input type="text" style="width: 25px;" name="order[urgent_num]"  value="{$data['urgent_num'] ?? ''}">天</div>
                            </td>
                        </tr>
                        <tr>
                           <td >订单金额</td>
                           <td colspan="1" ><input type="text" name="order[price]" required value="{$data['price'] ?? ''}"></td>
                           <td >实付金额</td>
                           <td colspan="1"><input type="text" name="order[true_price]" required value="{$data['true_price'] ?? ''}"></td>
                           <td>是否代加工</td>
                           <td colspan="4" style="padding: 0px;">
                             <input type="radio" class="is_ok" style="display: inline-block;width: auto;padding: 8px 0" name="order[is_ok]" value="1" {if condition="$data['is_dai'] eq 1"} checked="checked"{/if} disabled>是
                               <input type="radio" class="is_ok" style="display: inline-block;width: auto;padding: 8px 0" name="order[is_ok]" value="0" {if condition="$data['is_dai'] eq 0"} checked="checked"{/if} disabled>否
                               <div style="display: none;float: right;width: 50%;"id="gongchang">选择工厂<select name="order[gongchang]" id="" style="width: 65%;outline: none;margin-left: 10px;border: 0px; ">
                                  <option value="-1">请选择工厂</option>
                                    <option value="1">红岭</option>
                                    <option value="2">如意</option>
                                    <option value="3">鲁泰</option>
                               </select></div>
                           </td>
                       </tr>
                        <tr>
            <td colspan="1">付款方式</td>
            <td colspan="8">
                    <input class="is_dian" type="radio" name="order[payment]" value="1" style="display: inline-block;width: auto;padding: 1px" {if condition="$data['payment'] eq 1"} checked="checked"{/if} disabled>普通支付
                    <input class="is_dian" type="radio" name="order[payment]" value="0" style="display: inline-block;width: auto;padding: 1px" {if condition="$data['payment'] eq 0"} checked="checked"{/if} disabled>会员卡支付
                <div style="display: inline-block;">

                    <span id="huiyuan" style="display: none;margin-left: 30px;">
                        卡号：<input type="text" name="card_num" id="card_num" style="display: inline-block;width: auto;padding:1px " value="{$data['card_num'] ?? ''}" disabled>
                    </span>
                </div>
            </td>
        </tr>
                        <tr></tr>
                    </table>
                </div>
            </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">付款凭证：</label>
                        <div class="col-sm-6">
                            <img src="{$data['picurl']}" alt="">
                        </div>
                    </div>
    </div>
    <div class="panel-footer">
        <div class="row">
            <div class="col-sm-6 col-sm-offset-3">
                <input type="hidden" name="id" value="{$data['id'] ?? ''}">
                <button type="submit" class="btn btn-primary" style="margin:0 20px">提交</button>
                <button type="button" class="btn btn-default" onclick="javascript:history.back(-1);" style="margin:0 20px;">返回</button>
                <a data-toggle="modal"  href="#modal-form" class="btn btn-primary" title="驳回"> 驳回 </a>
            </div>
        </div>
    </div>
    <!-- panel-footer -->
    </form>

    <div id="modal-form" class="modal fade" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <div class="col-sm-12 b-r">
                        <h3 class="m-t-none m-b">驳回理由</h3>
                        <form role="form" action="{:url('index/order/gobackForAjaxCai')}" method="post">
                            <div class="form-group">
                                <input type="name" placeholder="请填写驳回理由" class="form-control" id="reaon" name="reaon">
                                <input type="hidden" id="orderid" name="orderid" value="{$data['id']}">
                            </div>
                            <div>
                                <button class="btn btn-sm btn-primary pull-right m-t-n-xs" type="submit"><strong>提交</strong>
                                </button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
{/block} {block name="js"}
<script>
    $(document).ready(function() {
        $("[name='order[gongchang]']").find("[value='{$data.gongchang ?? '-1'}']").attr("selected", true);
        if($('.is_ok:checked').val() == 1){
             $('#gongchang').css('display','block');
        }else{
            $('#gongchang').css('display','none');
        }
        if($('.is_dian:checked').val() == 0)
        {
            $('#huiyuan').css('display','block');
        }else{
            $('#huiyuan').css('display','none');
        }
    });
</script>
<script>
    function printHTML(page) {
        var bodyHTML = window.document.body.innerHTML;
        window.document.body.innerHTML = $(page).html();
        window.print();
        window.document.body.innerHTML = bodyHTML;
    }
</script>
<script>
    function getRegion(val, level) {
        var $city = $("#city");
        var $area = $("#area");
        $.post('{:url('index / common / getRegion')}', { pcode: val, level: level }, function (data) {
            var dataObj = eval("(" + data + ")");//转换为json对象   
            if (dataObj['code'] == 1) {
                if (level == '1') {
                    $.each(dataObj['list'], function (i, item) {
                        $city.append('<option value="' + item['code'] + '">' + item['name'] + '</option>');
                    });
                } else {
                    $.each(dataObj['list'], function (i, item) {
                        $area.append('<option value="' + item['code'] + '">' + item['name'] + '</option>');
                    });
                }
            }
        });
    }
</script>
<script>
    function getInfo(val) {
        var $user_id = $('#user_id');
        $.post('{:url('index / common / getInfo')}', { id: val }, function (data) {
            var dataObj = eval("(" + data + ")");//转换为json对象  
            if (dataObj['code'] == 1) {
                $.each(dataObj['list'], function (i, item) {
                    $user_id.append('<option value="' + item['id'] + '">' + item['truename'] + '</option>');
                });
            }
        });
    }
</script> 
<script>
  
   $(function () {
      $(".is_ok").click(function () {
          if ($(this).val() == 1) {
              //alert("选中了");
              $('#gongchang').css('display','block');
          }else{
            $('#gongchang').css('display','none');
          }
      });

           // 支付方式
      $(".is_dian").click(function(){
          if($(this).val() == 1){
              $('#huiyuan').css('display','none')
          }else{
              $('#huiyuan').css('display','block')
          }
          
      })
  });
</script>
{/block}